package com.yunjijia.controller;

import com.yunjijia.pojo.Built;
import com.yunjijia.pojo.User;
import com.yunjijia.service.IUserService;
import com.yunjijia.utils.R;
import com.yunjijia.utils.StatusCode;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UserController {

    @Resource
    private IUserService IUserService;

    /**
     * id查询
     * @return
     */
    @RequestMapping(value="/AllUser")
    public R allUser() {
        List<User> userList = IUserService.findAllUser();
        return new R(true, StatusCode.OK, "查询成功", userList);
    }

    /**
     * id查询
     * @return
     */
    @RequestMapping(value="/AllUsers")
    public R ss() {
        List<User> userList = IUserService.findAllUser();
        return new R(true, StatusCode.OK, "查询成功", userList);
    }

}


